package file.server

class AttachmentService
{

    File createFolder(String rootFolder, String l1Folder, String l2Folder, String l3Folder)
    {
        File folder1 = new File(rootFolder, l1Folder)
        if (!folder1.exists() && !folder1.isDirectory())
        {
            folder1.mkdir()
        }

        File folder2 = new File("${rootFolder}/${l1Folder}", l2Folder)
        if (!folder2.exists() && !folder2.isDirectory())
        {
            folder2.mkdir()
        }

        File folder3 = new File("${rootFolder}/${l1Folder}/${l2Folder}", l3Folder)
        if (!folder3.exists() && !folder3.isDirectory())
        {
            folder3.mkdir()
        }
        folder3
    }
}
